#!/usr/bin/env bash
[[ -n $(docker ps -aqf ancestor=redis:6.0) ]] && \
[[ -n $(docker rm -f redis60) ]]
run_id=$(docker run \
       -d \
       --name redis60 \
       --restart always \
       -p 9000:6379 \
       -v /data/docker/redis60/conf:/etc/redis  \
       -v /data/docker/redis60/data:/data  \
       --privileged=true \
       redis:6.0 \
       --requirepass "tyjw2020!" \
       --appendonly yes)
name=$(docker inspect -f "{{.Name}}" redis60)
binds=$(docker inspect -f "{{.HostConfig.Binds}}" redis60)
echo redis-name: "${name:1}"
echo redis-id: "${run_id:0:12}"
echo redis-binds: "${binds}"
echo "----------------------docker redis60 running successfully！-----------------------"
